﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Zor_IDAL;

namespace Zor_DAL
{
    public class Preview_DAL<T> where T : class
    {
        /// <summary>
        /// 获取详细信息
        /// </summary>
        /// <param name="Bd_Id"></param>
        /// <returns></returns>
        public static List<T> DetailInfo(int Bd_Id)
        {
            var sql = "select Bd_Id,Hs_Number,Hs_InFloor,NatPer_Name,NatPer_IDNumber,NatPer_Phone,NatPer_Sex,Hs_Proportion,Hs_Nature,Hs_attribute,Hs_HousUse,Hs_household,Statue from [V_HousingDetailInfo] where Bd_Id = " + Bd_Id + " order by Hs_Number";
            List<T> lst_DetailInfo = DapperQuery<T>.DoQueryList(sql, null);
            return lst_DetailInfo;
        }


        /// <summary>
        /// 获取导出部分列表数据
        /// </summary>
        /// <param name="where"></param>
        /// <returns></returns>
        public static List<T> SelectDetailInfo(string where = null)
        {
            string strwhere = "";
            if (!string.IsNullOrEmpty(where))
            {
                strwhere = "1=1 " + where;
            }
            else
            {
                strwhere = "1=1 ";
            }
            var sql = "select * from [dbo].[V_Preview] where " + strwhere + "";
            return DapperQuery<T>.DoQueryList(sql, null);
        }
    }
}
